<?php
/**
 * Created by PhpStorm.
 * User: shkj
 * Date: 2020/4/23
 * Time: 15:42
 */

namespace app\api\controller\v1;

use think\facade\Request;
class Attr extends Base
{

    private $obj;
    public function __construct() {

        $this->obj = model("attr");
    }

     public function select(){
        $id = Request::param('id');
        $type = Request::param('sel');
        $this->obj->select($id,$type);
    }

    public function add(){
    	$data = Request::param();
    	$this->obj->add($data);
    }

    public function detail(){
    	$id = Request::param('id');
    	$this->obj->detail($id);
    }

    public function edit(){
    	$id = Request::param('id');
    	$data = Request::post();
    	$this->obj->edit($id,$data);
    }

    public function delete(){
    	$id = Request::param('id');
    	$this->obj->del($id);
    }

    public function insert(){
    	$id = Request::param('id');
    	$type_id = Request::param('type_id');
    	$data = Request::post();
    
        
    	$this->obj->insert($id,$type_id,$data);
    }
}